package a20.com.yuejian_20.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TextView;

import a20.com.yuejian_20.R;


/**
 * Created by ASURA on 2017/9/20.
 */

public class LoginActivity extends Activity{
    private EditText name;
    private EditText pwd;
    private TextView resetpwd;
    private TextView register;
    private Button login;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_login);
        initView();
        initEvent();
    }

    private void initView(){
        name = (EditText)findViewById(R.id.name);
        pwd = (EditText)findViewById(R.id.password);
        resetpwd = (TextView)findViewById(R.id.resetpwd);
        register = (TextView)findViewById(R.id.register);
        login = (Button)findViewById(R.id.btn_login);
    }

    private void initEvent(){
        login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LoginActivity.this,MainActivity.class);
                startActivity(intent);
            }
        });

        register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);
                startActivity(intent);
            }
        });

    }
}
